Previous Book Contents Book Index Next

Inside Macintosh: AppleScript Language Guide / Part 3 - Appendixes
Appendix A - The Language at a Glance


Control Statements

Control statements are statements that control when and how other statements are executed. Table A-5 summarizes the control statements in the AppleScript English dialect. For more information about control statements, see Chapter 7, "Control Statements."
Control statements
Control
statement
Syntax
telltell referenceToObject to statement
 tell referenceToObject
[ statement ]...
end [ tell ]
ifif Boolean then statement
 if Boolean [ then ]
[ statement ]...
[ else if Boolean [ then ]
[ statement ]...]...
[ else
[ statement ]...]
end [ if ]
repeatrepeat
[ statement ]...
end [ repeat ]
 repeat integer [ times ]
[ statement ]...
end [ repeat ]
 repeat while Boolean
[ statement ]...
end [ repeat ]
 repeat until Boolean
[ statement ]...
end [ repeat ]
 repeat with variable from integer to integer [ by integer ]
[ statement ]...
end [ repeat ]
 repeat with variable in list
[ statement ]...
end [ repeat ]
exitexit
 
trytry
[ statement ]...
on error ¬
[ errorMessageVariable] ¬
[ number errorNumberVariable] ¬
[ from offendingObjectVariable ] ¬
[ partial result resultListVariable] ¬
[ to expectedTypeVariable ]
[ global variable [, variable]...]
[ local variable [, variable]...]
[ statement ]...
end [ error | try ]
consideringconsidering attribute [, attribute ... and attribute ] ÿ
[ but ignoring attribute [, attribute ... and attribute ] ]
[ statement ]...
end considering
ignoringignoring attribute [, attribute ... and attribute ] ÿ
[ but considering attribute [, attribute ... and attribute ] ]
[ statement ]...
end ignoring
with timeoutwith timeout [ of ] integer second[s]
[ statement ]...
end [ timeout ]
with transactionwith transaction [ session ]
[ statement ]...
end [ transaction ]


Previous Book Contents Book Index Next

© Apple Computer, Inc.
13 JUL 1996